#include <asm.h>
#include <csr.h>

ENTRY(setup_exception)
  /* TODO: */
  la t0, exception_handler_entry
  csrw CSR_STVEC, t0
  li t0, SIE_SSIE|SIE_STIE|SIE_SEIE
  csrw CSR_SIE, t0
  li t0, 0x2
  csrw CSR_SSTATUS, t0
  jr ra
ENDPROC(setup_exception)

/* maybe you need it? */
ENTRY(read_sip)
  csrr a0, CSR_SIP
  jr ra
ENDPROC(read_sip)
